﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.HTML
{
    #region Using Statements

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using KLF.Lib.Browser.DOM.Interface;

    #endregion

    /// <summary>
    /// Style information. See the STYLE element definition in HTML 4.01, 
    /// the CSS module [DOM Level 2 Style Sheets and CSS] and the LinkStyle 
    /// interface in the StyleSheets module [DOM Level 2 Style Sheets and CSS].
    /// </summary>
    public class HTMLStyleElement : HTMLElement, ILoadableContent
    {
        #region Constructors

        internal HTMLStyleElement(Document owner)
            : base(owner, "style")
        {

        }

        #endregion

        #region Attributes

        public bool HasLoaded { get; set; }

        public string RawCss { get; set; }

        #endregion

        #region DOM Level 2 HTML Compliance

        /// <summary>
        /// Enables/disables the style sheet.
        /// </summary>
        public bool disabled { get; set; }

        /// <summary>
        /// Designed for use with one or more target media. 
        /// See the media attribute definition in HTML 4.01.
        /// </summary>
        public string media
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_MEDIA);
            }
            set
            {
                setAttribute(HTMLConstants.HTML_ATT_MEDIA, value);
            }
        }

        public override string textContent
        {
            get
            {
                return "";
            }
            set
            {
                base.textContent = value;
            }
        }

        /// <summary>
        /// The content type of the style sheet language. See 
        /// the type attribute definition in HTML 4.01.
        /// </summary>
        public string type
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_TYPE);
            }
            set
            {
                setAttribute(HTMLConstants.HTML_ATT_TYPE, value);
            }
        }

        #endregion
    }
}
